#ifndef _GAME_TIME_H_
#define _GAME_TIME_H_

/**
* @brief
* Class that keeps truck of elapsed time while in game.
*/
class GameTime
{
	public:

		/**
		* @brief Constructor of GameTime class
		*/
		GameTime();

		/**
		* @brief Get Total time
		* @return Returns total time since Reset() method was last called in seconds
		*/
		float GetTotalTime() const; 

		/**
		* @brief Get Elapsed time
		* @return Returns elapsed time from previous frame to current frame in seconds
		*/
		float GetElapsedTime() const;

		/**
		* @brief Resets the time set to this class.
		*		 this method should be called before Tick() method is called for the first time.
		*/
		void Reset(); 

		/**
		* @brief Unpause the timer. Only call this method if the timer has been paseud.
		*/
		void Start(); 

		/**
		* @brief Psuses the timer. 
		*		 Tick() method does nothing and GetElapsedTime() method return 0.0f if the timer is paused
		*/
		void Pause(); 

		/**
		* @brief Updates the timer. 
		* This method should be called every frame (by default, the framework calls this method every frame)
		*/		
		void Tick(); 

	private:
		double m_secondsPerCount;
		double m_elapsedTime;

		__int64 m_startTime;
		__int64 m_pausedTime;
		__int64 m_stopTime;
		__int64 m_previousTime;
		__int64 m_currentTime;

		bool m_isStopped; //!< @brief Indicates whether the timer is paused or not
};

#endif // end of _GAME_TIME_H_